/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.gm.entities;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.ManyToMany;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Med EL MOUDDENE
 */
@Entity
@Table(name = "reeducation")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Reeducation.findAll", query = "SELECT r FROM Reeducation r"),
    @NamedQuery(name = "Reeducation.findByIdReeductation", query = "SELECT r FROM Reeducation r WHERE r.idReeductation = :idReeductation"),
    @NamedQuery(name = "Reeducation.findByIdGrouupe", query = "SELECT r FROM Reeducation r WHERE r.idGrouupe = :idGrouupe")})
public class Reeducation implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "ID_REEDUCTATION")
    private Integer idReeductation;
    @Lob
    @Size(max = 65535)
    @Column(name = "PRESENCE")
    private String presence;
    @Column(name = "ID_GROUUPE")
    private Integer idGrouupe;
    @ManyToMany(mappedBy = "reeducationCollection")
    private Collection<Groupe> groupeCollection;

    public Reeducation() {
    }

    public Reeducation(Integer idReeductation) {
        this.idReeductation = idReeductation;
    }

    public Integer getIdReeductation() {
        return idReeductation;
    }

    public void setIdReeductation(Integer idReeductation) {
        this.idReeductation = idReeductation;
    }

    public String getPresence() {
        return presence;
    }

    public void setPresence(String presence) {
        this.presence = presence;
    }

    public Integer getIdGrouupe() {
        return idGrouupe;
    }

    public void setIdGrouupe(Integer idGrouupe) {
        this.idGrouupe = idGrouupe;
    }

    @XmlTransient
    public Collection<Groupe> getGroupeCollection() {
        return groupeCollection;
    }

    public void setGroupeCollection(Collection<Groupe> groupeCollection) {
        this.groupeCollection = groupeCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idReeductation != null ? idReeductation.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Reeducation)) {
            return false;
        }
        Reeducation other = (Reeducation) object;
        if ((this.idReeductation == null && other.idReeductation != null) || (this.idReeductation != null && !this.idReeductation.equals(other.idReeductation))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.gm.entities.Reeducation[ idReeductation=" + idReeductation + " ]";
    }
    
}
